package com.itshi.demo1;

import java.util.Scanner;

/**
 * @author YS
 * @date 2021/7/3
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("头等舱全票:");
        int tou = sc.nextInt();
        System.out.println("经济舱全票:");
        int jing = sc.nextInt();
        System.out.println("请输入你要去游玩的月份:");
        int yue = sc.nextInt();
        int a = 0;
        while(true){
            System.out.println("0.乘坐头等舱    1.乘坐经济舱");
            a = sc.nextInt();
            if(a!=0&&a!=1){
                System.out.println("输入错误；请重新输入:");
            }else{
                break;
            }
        }
        switch (yue){
            case 1:
            case 2:
            case 3:
            case 4:
                if(a==0)
                    System.out.println("因为是淡季；头等舱价格为"+(tou*0.7)+"。");
                else
                    System.out.println("因为是淡季；经济舱价格为"+(jing*0.65)+"。");
                break;
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
                if(a==0)
                    System.out.println("因为是淡季；头等舱价格为"+(tou*0.9)+"。");
                else
                    System.out.println("因为是淡季；经济舱价格为"+(jing*0.85)+"。");
                break;
            case 11:
            case 12:
                if(a==0)
                    System.out.println("因为是淡季；头等舱价格为"+(tou*0.7)+"。");
                else
                    System.out.println("因为是淡季；经济舱价格为"+(jing*0.65)+"。");
                break;
            default:
                System.out.println("请输入正确的月份:");
                break;
        }

    }
}
